Hello World

Create a GX Context and say hello!

Every application must establish and hold the GX context. There are many properties that are part of the context and one of these is the Geosoft ID of the person running the program.


In [1]:
import geosoft.gxpy as gxpy
 
# a GX context is required, and must be assigned to a variable that persists through the life of execution.
gxc = gxpy.gx.GXpy()
 
# gid is a property of the context that holds the user's Geosoft ID.  Say hello.
print('Hello {}'.format(gxc.gid))


Hello Jacques.beaurain@geosoft.com

For example, here are all the properties of the GX context (skipping the private properties).


In [4]:
for property in gxc.__dict__:
    if property[0] != '_':
        print(property)


gid
current_date
current_utc_date
current_time
current_utc_time
folder_workspace
folder_temp
folder_user